package ioperations;

import book.BookList;

import java.util.Scanner;

public class DelOPeration implements IOPeration{
    public void walk(BookList booklists){
        System.out.println("请输入你要删除图书的名字:");
        Scanner scanner=new Scanner(System.in);
        String name=scanner.nextLine();
        for (int i=0;i<booklists.getUsedSize();i++){
            if((booklists.books[i].name).equals(name)){
                System.out.println("删除成功!!");
                booklists.setUsedSize(booklists.getUsedSize()-1);
                return;
            }
        }
        System.out.println("您输入图书的名字在书架里找不到，删除失败!!");
    }
}
